package com.tianhao.entity;

import com.tianhao.export.annotation.ExcelColumn;
import com.tianhao.export.annotation.ExcelFile;
import com.tianhao.export.annotation.MergeColumn;
import com.tianhao.export.render.BigDecimalRender;
import com.tianhao.export.render.DateRenderer;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 采购订单头,功能sodr-order
 *
 * @author jianbo.li@hand-china.com 2018-11-21 10:07:36
 */
@Data
@ExcelFile(excelName = "采购订单今天",
        serialNumEnable = true,
        serialNumGenerate = {"poNum","lineNum"},
        sheetCapacity = 2000)
public class PoHeader {

    //
    // 业务方法(按public protected private顺序排列)
    // ------------------------------------------------------------------------------


    //
    // 数据库字段
    // ------------------------------------------------------------------------------

    @ExcelColumn(name = "单号",width = 20)
    @MergeColumn(groupBy = {"poNum","lineNum"})
    private String poNum;
    @ExcelColumn(name = "行号",width = 10)
    @MergeColumn(groupBy = {"poNum","lineNum"})
    private Integer lineNum;
    @ExcelColumn(name = "产品编号",width = 30)
    private String productNum;
    @ExcelColumn(name = "产品名称",width = 30)
    private String productName;
    @ExcelColumn(name = "数量",width = 10 ,renderer = BigDecimalRender.class,pattern = "#,##0.00")
    private BigDecimal quantity;
    @ExcelColumn(name = "单位",width = 10)
    private String unit;
    @ExcelColumn(name = "so",width = 20)
    private String so;
    @ExcelColumn(name = "soItem",width = 10)
    private String soItem;
    @ExcelColumn(name = "icpo",width = 20)
    private String icpo;
    @ExcelColumn(name = "市场",width = 20)
    private String market;
    @ExcelColumn(name = "交货时间",width = 25, renderer = DateRenderer.class,pattern = "yyyy-MM-dd hh:mm:ss")
    private Date deliveryDate;
    @ExcelColumn(name = "物料编号",width = 20)
    private String itemNum;
    @ExcelColumn(name = "物料名称",width = 20)
    private String itemName;
    @ExcelColumn(name = "标准数量",width = 10,renderer = BigDecimalRender.class,pattern = "#,##0.00")
    private BigDecimal standerQuantity;
    @ExcelColumn(name = "需求数量",width = 10,renderer = BigDecimalRender.class,pattern = "#,##0.00")
    private BigDecimal needQuantity;
    // 同 poNum 和 lineNum 的要合并inkjetCodeRequirement字段
    @MergeColumn(groupBy = {"poNum","lineNum"})
    @ExcelColumn(name = "喷码要求",width = 30)
    private String inkjetCodeRequirement;


}
